import { Module } from "vuex";
import {RoutesListState, RootStateTypes}  from '@/store/interface/index'

const routesListModule: Module<RoutesListState, RootStateTypes> = {
    namespaced: true,
    state: {
        routesList: [],
        isColumnsMenuHover: false,
        isColumnsNavHover: false
    },
    mutations: {
        getRoutesList(state:any, data:any){
            state.routesList = data;
        },
        getColumnsMenuHover(state: any, bool: boolean){
            state.isColumnsMenuHover = bool
        },
        getColumnsNavHover(state: any, bool: boolean) {
            state.isColumnsNavHover = bool
        }
        
    },
    actions: {
        async setRoutesList({commit}, data: any){
            commit('getRoutesList', data)
        },
        async setColumnsMenuHover({commit}, bool: boolean) {
            commit('getColumnsMenuHover', bool)
        },
        async setColumnsNavHover({commit}, bool: boolean){
            commit('getColumsNavHover', bool)
        }
    }
}
export default routesListModule